import Vue from "vue";
import Popups from "@/components/Popups";

Vue.prototype.Popups = Popups;
Vue.prototype.checkLogin = () => {
  // 判断当前是否登录
  let status = !!window.loginStatus;
  if (!status) {
    // 判断平台
    if (window.from === "android" || window.from === "ios") {
      window.injectedAll.openLogin(); // 唤起登录
    } else {
      Popups.Alert().noApp();
    }
    throw Error("未登录");
  }
};
